home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
utility
/
mu17_ext.zip
/
DEBUGLIB.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-03-07
|
1KB
|
58 lines
/*
** $VER: debuglib.c 1.0 (07.02.94)
**
** debug.library functions
**
** ⌐ Copyright 1994 by Norbert Pⁿschel
** All Rights Reserved
*/
#include <proto/exec.h>
#include <proto/dos.h>
#include <dos/dostags.h>
#include <string.h>
struct DosLibrary *DOSBase;
struct SignalSemaphore S;
BOOL __saveds __asm LIBGlobalAlloc(register __d0 struct Library *Base)
{
DOSBase = (struct DosLibrary *)OpenLibrary("dos.library",37);
if(DOSBase) {
memset(&S,0,sizeof(struct SignalSemaphore));
InitSemaphore(&S);
return(TRUE);
}
return(FALSE);
}
BOOL __saveds __asm LIBGlobalFree(register __d0 struct Library *Base)
{
CloseLibrary((struct Library *)DOSBase);
return(TRUE);
}
void __saveds __asm LIBDEBUGA(register __d1 STRPTR fname,
register __d2 STRPTR format,
register __d3 LONG *args)
{
BPTR file;
ObtainSemaphore(&S);
file = Open(fname,MODE_READWRITE);
if(file) {
Seek(file,0,OFFSET_END);
VFPrintf(file,format,args);
Close(file);
}
ReleaseSemaphore(&S);
}